import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'cuttingStr'
})
export class CuttingStrPipe implements PipeTransform {

  transform(value: any, args?: any, symbol?: any): any {
    if(value) {
      if(!symbol){
          symbol = "..."
      }
      if(args) {
        if(value.length<args) {
          return value;
        }
        return value.substr(0, args)+symbol;
      }

      if(value.length<10) {
        return value;
      }
      return value.substr(0, args) + symbol;

    }
  }

}
